Listing 12 - Page 0: No Title

##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 12\12.1512 - No Title.py
# Description: No Title
##############################################################################

def pattern_check(entry, patterns):
    position = 0
    for pattern in patterns:
        found, _, end = pattern(entry[position:])
        if found > 0:
            position += end + 1
        else:
            return -1, -1, -1
    return 1, 0, position - 1
Click here to download the file